package com.zero.zeroframe.ktx

import android.text.TextUtils

/**
 * 输出double值
 */
fun String.textToDouble():Double {
    if (TextUtils.isEmpty(this)){
        return 0.0
    }
    return toDouble()
}

/**
 * 输出int值
 */
fun String.textToInt():Int {
    if (TextUtils.isEmpty(this)){
        return 0
    }
    return try {
        toFloat().toInt()
    } catch (e:Exception){
        0
    }
}